<%@ page import="com.google.appengine.api.datastore.Entity" %>
<html>
<body>
    <h1>Update <%=request.getAttribute("name")%></h1>
 
    <%
        Object obj = request.getAttribute("obj");
    %>
 
    <form method="post" action="../update" > 
        <table>
            <%
                String[] columns = (String[])request.getAttribute("columns");
                for(String column : columns) {
            %>
            <tr>
                <td>
                    <%=column%> :
                </td>
                <td>
                    <%
                    if (column.equals("id")){
                    %>
                    <input readonly = true type="text" style="width: 185px;" 
                                             maxlength="30" name="<%=column%>" id="<%=column%>" 
                        value="<%=obj.getClass().getMethod("get" + column.substring(0, 1).toUpperCase() + column.substring(1)).invoke(obj)%>" />
                    <%
                    }
                    else{
                    %>
                    <input type="text" style="width: 185px;" 
                                             maxlength="30" name="<%=column%>" id="<%=column%>" 
                        value="<%=obj.getClass().getMethod("get" + column.substring(0, 1).toUpperCase() + column.substring(1)).invoke(obj)%>" />
                    <%    
                    }
                    %>
                </td>
            </tr>
            <%
                }
            %>
        </table>
        <input type="submit" class="update" title="Update" value="Update" />
    </form>
 
</body>
</html>